@use "scss/variables";
@use "scss/colors";
@use "scss/z-indices";

.button {
  width: 100%;
  cursor: pointer;
  background-color: initial;
  color: colors.$dark-blue;
  border: 1px solid colors.$grey-200;
  border-radius: variables.$border-radius-sm;
  padding: 7px 8px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: variables.$spacing-md;
  font-size: variables.$font-size-lg;
  line-height: 1.4;
  min-height: 36px;

  &:disabled {
    border-color: colors.$grey-100;
    cursor: default;
  }

  &[aria-expanded="true"] {
    border-color: colors.$blue;
  }

  &:hover:not(:disabled) {
    border-color: colors.$grey-300;
  }

  &:focus:not(:disabled) {
    border-color: colors.$blue;
  }

  &:hover:not(:disabled)[aria-expanded="true"] {
    border-color: colors.$blue;
  }

  &--error {
    border-color: colors.$red-200;

    &:hover:not(:disabled) {
      border-color: colors.$red;
    }
  }

  .disabledText {
    color: colors.$grey-300;
  }
}

.defaultControlButton {
  font-weight: normal;
}

.optionsMenu {
  background-color: colors.$foreground;
  border-radius: variables.$border-radius-lg;
  box-shadow: variables.$box-shadow-menu;
  padding: 0;
  margin: 0;
  width: 100%;
  min-width: variables.$min-width-listbox-options-list;
  max-height: variables.$height-long-listbox-options-list;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: auto;

  &.nonAdaptive {
    max-width: variables.$min-width-listbox-options-list;
  }
}

.option {
  list-style-type: none;
  overflow: visible;
}

.optionValue {
  padding: (variables.$spacing-xs + variables.$spacing-md) variables.$spacing-lg;
  cursor: pointer;
}

.icon {
  max-width: 18px;
  max-height: 18px;
}

.label {
  color: inherit;
  font-size: variables.$font-size-lg;
}

.active {
  background-color: colors.$grey-50;
}

.selected {
  background-color: colors.$blue-50;
}

.disabled {
  color: colors.$grey-300;
}
